<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyPetStore</title>
    <link rel="Stylesheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<middle th:fragment="middle">
<div id="Content">
    <h3>Account Information</h3>

    <table>
        <tr>
            <td>First name:</td>
            <td>
                <input type="text" name="firstName"  th:if="${session.account!=null}" th:value="${session.account.firstName}"/>
                <input type="text" name="firstName" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>Last name:</td>
            <td>
                <input type="text" name="lastName" th:if="${session.account!=null}" th:value="${session.account.lastName}"/>
                <input type="text" name="lastName" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>Email:</td>
            <td>
                <input type="text" size="40" name="email" th:if="${session.account!=null}" th:value="${session.account.email}"/>
                <input type="text" size="40" name="email" th:if="${session.account==null}" value=""/>
            </td>

        </tr>
        <tr>
            <td>Phone:</td>
            <td>
                <input type="text" name="phone" th:if="${session.account!=null}" th:value="${session.account.phone}"/>
                <input type="text" name="phone" th:if="${session.account==null}" value=""/>
            </td>

        </tr>
        <tr>
            <td>Address 1:</td>
            <td>
                <input type="text" size="40" name="address1" th:if="${session.account!=null}" th:value="${session.account.address1}"/>
                <input type="text" size="40" name="address1" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>Address 2:</td>
            <td>
                <input type="text" size="40" name="address2" th:if="${session.account!=null}" th:value="${session.account.address2}"/>
                <input type="text" size="40" name="address2" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>City:</td>
            <td>
                <input type="text" name="city" th:if="${session.account!=null}" th:value="${session.account.city}"/>
                <input type="text" name="city" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>State:</td>
            <td>
                <input type="text" size="4" name="state" th:if="${session.account!=null}" th:value="${session.account.state}"/>
                <input type="text" size="4" name="state" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>Zip:</td>
            <td>
                <input type="text" size="10" name="zip" th:if="${session.account!=null}" th:value="${session.account.zip}"/>
                <input type="text" size="10" name="zip" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>Country:</td>
            <td>
                <input type="text" size="15" name="country" th:if="${session.account!=null}" th:value="${session.account.country}"/>
                <input type="text" size="15" name="country" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
    </table>

    <h3>Profile Information</h3>

    <table>
        <tr>
            <td>Language Preference:</td>
            <td>
                <select name="languagePreference" th:if="${session.account!=null}" th:value="${session.account.languagePreference}">
                    <option value="english" selected="selected">english</option>
                    <option value="japanese">japanese</option>
                </select>
                <select name="languagePreference" th:if="${session.account==null}" value="">
                    <option value="english" selected="selected">english</option>
                    <option value="japanese">japanese</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>Favourite Category:</td>
            <td>
                <select name="favouriteCategoryId" th:if="${session.account!=null}" th:value="${session.account.favouriteCategoryId}">
                    <option value="FISH">FISH</option>
                    <option selected="selected" value="DOGS">DOGS</option>
                    <option value="REPTILES">REPTILES</option>
                    <option value="CATS">CATS</option>
                    <option value="BIRDS">BIRDS</option>
                </select>
                <select name="favouriteCategoryId" th:if="${session.account==null}" value="">
                    <option value="FISH">FISH</option>
                    <option selected="selected" value="DOGS">DOGS</option>
                    <option value="REPTILES">REPTILES</option>
                    <option value="CATS">CATS</option>
                    <option value="BIRDS">BIRDS</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>Enable MyList</td>
            <td>
                <input type="checkbox" name="listOption" th:id="${session.account!=null}?'listOption':'456'" th:if="${session.account!=null}" th:value="${session.account.listOption}"/>
                <input type="checkbox" name="listOption" th:id="${session.account==null}?'listOption':'456'" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
        <tr>
            <td>Enable MyBanner</td>
            <td>
                <input type="checkbox" name="bannerOption" th:id="${session.account!=null}?'bannerOption':'123'" th:if="${session.account!=null}" th:value="${session.account.bannerOption}"/>
                <input type="checkbox" name="bannerOption" th:id="${session.account==null}?'bannerOption':'123'" th:if="${session.account==null}" value=""/>
            </td>
        </tr>
    </table>
</div>
</middle>
</body>
</html>